/**   
 * @Title: BindMobileCommunicater.java 
 * @Package： com.esun.rabbit2.communicaters.myinfo 
 * @Description: 绑定手机号通讯类 
 * @Author Miko baoz@500wan.com   
 * @Date 2011-7-3 下午06:42:50  
 * Copyright (C) 2011 Shenzhen E-sun Sky Net Technology Co.,ltd.
 */
package com.esun.rabbit2.communicaters.myinfo;

import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;

import javax.xml.parsers.ParserConfigurationException;

import org.apache.http.client.ClientProtocolException;
import org.xml.sax.SAXException;

import com.esun.config.BussinessCode;
import com.esun.config.Key;
import com.esun.model.UserInfo;
import com.esun.network.ServerCommunicater;


/** 
* @ClassName: GetMobileBindAuthCodeCommunicater 
* @Description: 获取手机绑定验证码 
* @author: Liujun liuj@500wan.com
* @date: 2012-6-28 下午4:11:21 
*  
*/
public class GetMobileBindAuthCodeCommunicater extends ServerCommunicater {

	public boolean bind(String strNum) throws ClientProtocolException, IOException, ParserConfigurationException, SAXException {

		ArrayList<HashMap<String, String>> list = new ArrayList<HashMap<String, String>>();

		list.add(mapItem(BussinessCode.PASER_MID, BussinessCode.MID_GET_MOBILE_BIND_AUTHCODE));
		list.add(mapItem(BussinessCode.PASER_CK, UserInfo.getUserInfo().getUserSession()));

		list.add(mapItem(Key.KEY_MOBILENUM, strNum));

		super.getServerResponse(list, true);

		if (super.getState() == 100) {
			return true;
		} else {
			return false;
		}
	}

	private HashMap<String, String> mapItem(String name, String value) {
		HashMap<String, String> map = new HashMap<String, String>();
		map.put(name, value);
		return map;
	}
}
